class Lily

	class EntryStates < Hash
		def initialize(fn)
			super()
			@fn = fn

			if File.exist?(@fn)
				begin
					db = PStore.new(@fn)
					db.transaction(true) { self.merge!(db['root']) }
				rescue
				end
			end
		end

		def add(file)
			mtime = File.mtime(file)
			@entrydate ||= PStore.new(@fn)
			@entrydate.transaction {
				@entrydate['root'] = {} unless @entrydate['root']
				@entrydate['root'][file] = mtime
			}
			self[file] = mtime
			mtime
		end
	end

end
